//
//  DemoDelegateViewController.m
//  DemoDelegate
//
//  Created by liu ming on 11-6-20.
//  Copyright 2011 peixin. All rights reserved.
//

#import "DemoDelegateViewController.h"

@implementation DemoDelegateViewController

@synthesize result;

-(IBAction) gotoSecondView:(id) sender
{
	SecondViewController *secondvw = [[SecondViewController alloc] initWithNibName:@"SecondViewController"
																			bundle:nil];
	secondvw.delegate = self;
	UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:secondvw];
	[self presentModalViewController:navController animated:YES];
	[secondvw release];
	[navController release];
}

-(void)sum:(int)val1 secondparam:(int)val2
{
	int a;
	a = val1 + val2;
	result.text = [NSString stringWithFormat:@"Sum is %d",a];
}

-(void)multiply:(int)x secondvalue:(int)y
{
	int a;
	a = x * y;
	result.text = [NSString stringWithFormat:@"Multiplication is %d",a];
}

- (void)didReceiveMemoryWarning {
	// Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
	
	// Release any cached data, images, etc that aren't in use.
}

- (void)viewDidUnload {
	// Release any retained subviews of the main view.
	// e.g. self.myOutlet = nil;
}


- (void)dealloc {
	[result release];
    [super dealloc];
}

@end
